# 重定向  302

from flask import Flask,redirect,url_for

app = Flask(__name__)

@app.route('/index')
def index():
    return redirect('https://www.baidu.com')

@app.route('/hello')
def world():
    return redirect(url_for('hello'))

@app.route('/world')
def hello():
    return 'this is url_for'

if __name__ == '__main__':
    app.run()